<?php
namespace frontend\components;

use yii\base\Widget;
use yii\helpers\Html;

class HotDocWidget extends Widget
{
	public $hotDocs;


	
	public function init()
	{
		parent::init();
	}
	
	public function run()
	{
		$docString1='';

		foreach ($this->hotDocs as $doc)
		{

			$docString1.='<ul class="list-group">'.
					'<li class="list-group-item"style="background:#303030 ;color:#FFF"><div class="doc"><div class="title">'.'<h4>'.
					'<a href="' .$doc->url.'"><b>'.
					Html::encode($doc->title).'</b></a></h4>'.
					'<div class="author"><span class="glyphicon glyphicon-time" aria-hidden="true"></span><em>'.date('Y-m-d H:i:s',$doc->time).'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</em>'.
					
					'<span class="glyphicon glyphicon-user" aria-hidden="true"></span>&nbsp;&nbsp;<em>
							'.Html::encode($doc->authorname).'</em></div></div><br>'.
					'<div class="content">'.Html::encode($doc->beginning).'</div><br><div class="nav"><span class="glyphicon glyphicon-tag" aria-hidden="true"></span>'.
					implode(', ',$doc->keywordLinks).'<br>最后修改于'.date('Y-m-d H:i:s',$doc->lastedit).'</div></div></li></ul>';
		}
		return  $docString1;
	}
}